Add a notion of "physical" sysroot, use for remote writing
authorColin Walters <walters@verbum.org>
Tue, 30 May 2017 18:07:13 +0000 (14:07 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 1 Jun 2017 18:15:56 +0000 (18:15 +0000)
commit1eff3e83436b6129c0dc350dbbda52ba330e3834
tree5c293c9332409816fdb573f1993bd852cc137cf9
parent241470460922c71e69beb3e0ac09c3840f33e200
Add a notion of "physical" sysroot, use for remote writing

Using `${sysroot}` to mean the physical storage root: We don't want to write to
`${sysroot}/etc/ostree/remotes.d`, since nothing will read it, and really
`${sysroot}` should just have `/ostree` (ideally). Today the Anaconda rpmostree
code ends up writing there. Fix this by adding a notion of "physical" sysroot.
We determine whether the path is physical by checking for `/sysroot`, which
exists in deployment roots (and there shouldn't be a `${sysroot}/sysroot`).

In order to unit test this, I added a `--sysroot` argument to `remote add`.
However, doing this better would require reworking the command line parsing for
the `remote` argument to support specifying `--repo` or `--sysroot`, and I
didn't quite want to do that yet in this patch.

Closes: https://github.com/ostreedev/ostree/issues/892
Closes: #896
Approved by: jlebon
src/libostree/ostree-repo-private.h
src/libostree/ostree-repo.c
src/libostree/ostree-sysroot-private.h
src/libostree/ostree-sysroot.c
src/ostree/ot-remote-builtin-add.c
tests/admin-test.sh
tests/test-admin-deploy-grub2.sh
tests/test-admin-deploy-syslinux.sh
tests/test-admin-deploy-uboot.sh